{% extends 'group_base.html' %}

{% block theme %}
{{ post.title|truncatewords:2 }}
{% endblock %}

{% block topic_content %}


<div class="topic-content clearfix">

	<div class="user-face">
		<a href="">
			{% if post.poster.image %}
			<img class="pil" src="/{{ post.poster.image }}" alt={{ post.poster.name }}>
			{% else %}
			<img class="pil" src="/image/default_user.gif" alt={{ post.poster.name }}>
			{% endif %}
		</a>
	</div>
	<div class="topic-doc">
		<h3>
			<span class="color-green">{{post.post_datetime|date:"Y-m-j f"}} </span>
			<span class="pl20">
			 来自
			 <a href="">{{post.poster.name}}</a>

			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</span>
			{% if is_host %}
				<span style="float: right;">
					<a href="/group/update_topic/{{post.id}}/">修改</a>
				</span>
			{% endif %}
			{% if is_admin %}
				<span style="float: right;">
					{% if post.elite %}
					<a href="/group/deal_post/{{post.id}}/cancel_elite/">取消加精</a> &nbsp;
					{% else %}
					<a href="/group/deal_post/{{post.id}}/elite/">加精</a> &nbsp;
					{% endif %}
					{% if post.stick %}
					<a href="/group/deal_post/{{post.id}}/cancel_stick/">取消置顶</a> &nbsp;
					{% else %}
					<a href="/group/deal_post/{{post.id}}/stick/">置顶</a> &nbsp;&nbsp;&nbsp;&nbsp;
					{% endif %}
					<a href="/group/deal_post/{{post.id}}/delete/">删除</a>(慎用) &nbsp;&nbsp;&nbsp;&nbsp;
				</span>
			{% endif %}
		</h3>
		<p>
		{{ post.content|safe }}
		</p>
		<div class="topic-opt clearfix"> </div>
	</div>
</div>
<div style="padding-bottom: 15px; font-size: 13px;">
	{% if attach_url %}
	<span>附件下载:&nbsp;</span>
	<!--
	<a href="{{ STATIC_URL }}download/{{ attach_url }}">	
		{{ post.attachment }}
	</a>
	-->
	<a href="/download/{{ post.id }}/">
		{{ post.attachment }}
	</a>
	{% endif %}
</div>
<script type="text/javascript">
$(document).ready(function(){
	$(".click_tip").click(function(){
		$(".blocktip").css("display", "block");
	});
	
	$(".disappear").click(function(){
		$(".blocktip").css("display", "none");
	});
});
</script>
<h2 style="margin-bottom: 25px; ">
	{% if is_member %}
	<a href="/group/post/{{post.id}}/page/{{final_page}}/#reply" class="rr bn-post" style="text-decoration:none">
		回复
	</a>
	{% else %}
	<span class="tipwrap rr">
		<a class="j click_tip bn-post" style="text-decoration:none">
			<span>回复</span>
		</a>
		<div class="blocktip group_say" >
			<div class="blocktip_content group_say_content">
				<div>先加入小组</div>
			</div>
			<input class="disappear" type="submit" value="知道了">
		</div>
	</span>
	{% endif %}
	&nbsp;&nbsp;<span>回复内容 ···</span>
</h2>


<ul class="topic-reply">
	{% for reply in replies %}
	<li class="clearfix">
		<div class="user-face">
			<a href="">
				{% if reply.replier.image %}
				<img class="pil" src="/{{reply.replier.image}}" alt={{reply.replier.name}}>
				{% else %}
				<img class="pil" src="/image/default_user.gif" alt={{reply.replier.name}}>
				{% endif %}
			</a>
		</div>
		<div class="reply-doc">
			<div class="bg-img-green">
				<h4>				
				楼层:
				{% if reply.floor_num == 1 %}
					沙发
				{% else %}
					{{ reply.floor_num }} 楼
				{% endif %}
				&nbsp;|&nbsp;
				{{reply.reply_datetime|date:"Y-m-j f"}}
				&nbsp;|&nbsp;
				<a href="">{{reply.replier.name}}</a>
				
				{%if is_admin or is_host %}
					<a href="/group/deal_post/{{post.id}}/delete_reply/{{reply.id}}/{{current_page}}/" style="padding-left: 40px">删除该楼</a>
				{% endif %}
				</h4>
			</div>
			<p>{{reply.content|safe}}</p>
			<!--
			<div class="group_banned">
				<span class="gact hidden p_u48755593 p_u3924589 p_group_admin p_admin p_intern fright">
					&gt;
					<a rel="nofollow" href="http://" class="j a_confirm_link" title="真的要删除沈不大胡子的发言?">删除</a>
				</span>
			</div>
			-->
		</div>
	</li>
	{% endfor %}
</ul>
{% if current_page == final_page %}
{% if is_member %}
	<!--
	{% if error %}
		<span class="error">回复字数不能少于10</span>
	{% endif %}
	-->
			
<h2 style="padding-top:45px;"><a name="reply"><span>&nbsp;&nbsp;你的回应 ···</span></a></h2>

<div class="txd">
	<form name="comment_form" method="post" action="/group/add_reply/{{post.id}}/{{current_page}}/">
		<div style="display:none;">
			<input type="hidden" name="ck" value="V2yY">
		</div>
		{% include "wmd_css.html" %}
		{% include "wmd_js.html" %}
		<!--<textarea id="last" name="content" rows="8" cols="54"></textarea>-->
		<div id="wmd-button-bar" class="wmd-panel"></div>
		<div><textarea rows="10" cols="40" name="content" id="wmd-input" class="processed"></textarea></div>
		<div id="wmd-preview" class="wmd-panel"></div>
		<br/>
		<!--<div id="wmd-output" class="wmd-panel"></div><br>	-->
		
		<input type="hidden" name="start" value="0">
		<input type="submit" value="加上去">
	</form>
</div>
{% endif %}
{% endif %}

{% endblock %}

{% block aside %}

<p class="pl2">
	&gt;
	<a href="/group/gr/{{ group.id }}/">返回&nbsp;{{ group.name }}</a>
</p>
<br>
<h2 class="usf">最新话题：</h2>
<div class="indent">
	{% for post in new_posts %}
	<p class="pl ul">
		<a href="/group/post/{{ post.id }}/" title={{ post.title }} >{{ post.title }}</a>
		<span class="pl">&nbsp;&nbsp;({{post.poster.name}})</span>
	</p>
	{% endfor %}
</div>

{% endblock %}